/*
 * Copyright (c) 2002-2006 by OpenSymphony
 * All rights reserved.
 */
package org.fordprefect.struts2jscalendarplugin.views.jsp.ui;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;
import org.fordprefect.struts2jscalendarplugin.components.Head;

import com.opensymphony.xwork2.util.ValueStack;

/**
 * @see Head
 */
@SuppressWarnings("serial")
public class HeadTag extends AbstractUITag {

	private String calendarcss;
	private String language;

	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		return new Head(stack, req, res);
	}

	@Override
	protected void populateParams() {
		super.populateParams();
		if (calendarcss != null) {
			((Head) component).setCalendarcss(calendarcss);
		}
		if (language != null) {
			((Head) component).setLanguage(language);
		}
	}

	public String getCalendarcss() {
		return calendarcss;
	}

	public void setCalendarcss(String calendarcss) {
		this.calendarcss = calendarcss;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getLanguage() {
		return language;
	}
}
